package net.zjitc.object.shape;

import java.util.Scanner;

/**
 * @Author admin
 * @Date 2019/3/20 9:17
 * 测试类
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("1--圆形\n2--长方形\n3--三角形");
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();


        /* 调用工厂类的方法来得到对象*/
        Shape shape=ShapeFactory.getShape(a);
        shape.print();



        /*Shape shape;
        if(a==1){
            shape=new Circle("圆形");
        }else if(a==2){
            shape=new Rectangle("长方形");
        }else if(a==3){
            shape=new Triangle("三角形");
        }else{
            shape=new Shape("图形");
        }*/

    }
}
